// 重置浏览器自带的默认样式，避免不同UA之间的样式差异。
import 'reset-css';

export function onRouteChange({ location, routes, action }: any) {
  if (action == 'POP') {
    console.log('首次加载');
    if (process.env.envType !== 'dev') {
      console.log(123);
      const hm = document.createElement('script');
      hm.src = 'https://hm.baidu.com/hm.js?8f23edcaa5f0a825d3b30013c4b09c84';
      const s = document.getElementsByTagName('script')[0];
      // @ts-ignore
      s.parentNode.insertBefore(hm, s);
    }
  }
}
